/*
 *  Copyright 2010 Farent-Solutions Ltd.
 * 
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 * 
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */
package com.farent.solutions.plugins.aribaweb.ui;

import com.farent.solutions.plugins.aribaweb.NBawConstants;
import javax.swing.JComponent;
import javax.swing.JPanel;
import org.netbeans.spi.project.ui.support.ProjectCustomizer;
import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category;
import org.openide.util.Lookup;

/**
 *
 * @author user
 */
public class NBawCompositePanelProvider implements ProjectCustomizer.CompositeCategoryProvider {

    private static final String SOURCES = "Sources";
    static final String LIBRARIES = "Libraries";
    private String name;

    private NBawCompositePanelProvider(String name) {
        this.name = name;
    }

    @Override
    public Category createCategory(Lookup lkp) {
        ProjectCustomizer.Category toReturn = null;
        if (SOURCES.equals(name)) {
            toReturn = ProjectCustomizer.Category.create(
                    SOURCES, "Sources",
                    null);
        } else if (LIBRARIES.equals(name)) {
            toReturn = ProjectCustomizer.Category.create(
                    LIBRARIES, "Libraries", // NOI18N
                    null);
        }
        assert toReturn != null : "No category for name:" + name;
        return toReturn;
    }

    @Override
    public JComponent createComponent(Category ctgr, Lookup lkp) {
        return new JPanel();
    }

    @ProjectCustomizer.CompositeCategoryProvider.Registration(projectType = NBawConstants.PROJECT_PATH,
    position = 100)
    public static NBawCompositePanelProvider createSources() {
        return new NBawCompositePanelProvider(SOURCES);
    }

    @ProjectCustomizer.CompositeCategoryProvider.Registration(projectType = NBawConstants.PROJECT_PATH,
    position = 200)
    public static NBawCompositePanelProvider createLibraries() {
        return new NBawCompositePanelProvider(LIBRARIES);
    }
}
